package ${packageName}.${moduleName}.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import ${packageName}.${moduleName}.service.${capitalizeName}Service;
import ${packageName}.${moduleName}.model.${capitalizeName};
import ${packageName}.${moduleName}.model.ServiceResult;

/**
 * ${functionName}
 * @author ${author}
 * @date ${date} 
 */
@Controller
public class ${capitalizeName}Action{
	
	@Autowired
	private ${capitalizeName}Service ${uncapitalizeName}Service;
	
	/**
	 * id查询
	 * @return
	 */
	@ResponseBody
    @RequestMapping("/get-model")  
    public ServiceResult<${capitalizeName}> get${capitalizeName}(Integer id){  
        return ${uncapitalizeName}Service.get${capitalizeName}(id);
    }
	
	/**
	 * 更新
	 * @return
	 */
	@ResponseBody
    @RequestMapping("/update-modele") 
	public ServiceResult<String> update${capitalizeName}(${capitalizeName} ${uncapitalizeName}){
		return ${uncapitalizeName}Service.update${capitalizeName}(${uncapitalizeName});
	}
	
	/**
	 * 添加
	 * @return
	 */
	@ResponseBody
    @RequestMapping("/add-modele") 
	public ServiceResult<String> add${capitalizeName}(${capitalizeName} ${uncapitalizeName}){
		return ${uncapitalizeName}Service.add${capitalizeName}(${uncapitalizeName});
	}
	
	/**
	 * 删除
	 */
	@ResponseBody
    @RequestMapping("/delete-modele") 
	public ServiceResult<String> delete${capitalizeName}(Integer id){
		return ${uncapitalizeName}Service.delete${capitalizeName}(id);
	}
}